package io;

import java.io.FileOutputStream;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws Exception{
        FileOutputStream fos = new FileOutputStream("test.txt", true);
        String line = "小时候的风在吹过";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);

        line = "现在风在吹";
        data = line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        System.out.println("再见！");
        fos.close();
    }
}
